package com.situ.day11;

import java.awt.BorderLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

public class BorderLayoutDemo {

	public static void main(String[] args) {
		JFrame frame = new JFrame("BorderLayout");
//		frame.setTitle("BorderLayout");
		JPanel panel = new JPanel();
		frame.add(panel);
		panel.setLayout(new BorderLayout());
		JButton northButton = new JButton("北部");
		JButton southButton = new JButton("南部");
		JButton westButton = new JButton("西部");
		JButton eastButton = new JButton("东部");
		JButton centerButton = new JButton("中部");
		panel.add(northButton, BorderLayout.NORTH);
		panel.add(southButton, BorderLayout.SOUTH);
		panel.add(westButton, BorderLayout.WEST);
		panel.add(eastButton, BorderLayout.EAST);
		panel.add(centerButton, BorderLayout.CENTER);

		frame.setSize(500, 400);
		frame.setLocation(500, 200);
		frame.setVisible(true);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

	}

}
